package task.snake.controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import task.snake.model.SnakeModel;

/**
 * Class implements interface ActionListener and handle pressing Start button.
 * 
 * @author Nadezhda Makarkina
 * 
 */
public class StartListener implements ActionListener {
	private SnakeModel snakeModel;

	/**
	 * Constructor creates StartListener object and sets snakeModel as
	 * parameter.
	 * 
	 * @param snakeModel
	 */
	public StartListener(SnakeModel snakeModel) {
		this.snakeModel = snakeModel;
	}

	/**
	 * Method handles pressing Start button and calls model's method
	 * startCreatures().
	 */
	public void actionPerformed(ActionEvent e) {
		snakeModel.startCreatures();
	}

}
